package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerLeaveRequestsMapper;
import com.traffic.domain.PerLeaveRequests;
import com.traffic.service.IPerLeaveRequestsService;

/**
 * 请假申请Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerLeaveRequestsServiceImpl implements IPerLeaveRequestsService 
{
    @Autowired
    private PerLeaveRequestsMapper perLeaveRequestsMapper;

    /**
     * 查询请假申请
     * 
     * @param overtimeId 请假申请主键
     * @return 请假申请
     */
    @Override
    public PerLeaveRequests selectPerLeaveRequestsByOvertimeId(Long overtimeId)
    {
        return perLeaveRequestsMapper.selectPerLeaveRequestsByOvertimeId(overtimeId);
    }

    /**
     * 查询请假申请列表
     * 
     * @param perLeaveRequests 请假申请
     * @return 请假申请
     */
    @Override
    public List<PerLeaveRequests> selectPerLeaveRequestsList(PerLeaveRequests perLeaveRequests)
    {
        return perLeaveRequestsMapper.selectPerLeaveRequestsList(perLeaveRequests);
    }

    /**
     * 新增请假申请
     * 
     * @param perLeaveRequests 请假申请
     * @return 结果
     */
    @Override
    public int insertPerLeaveRequests(PerLeaveRequests perLeaveRequests)
    {
        return perLeaveRequestsMapper.insertPerLeaveRequests(perLeaveRequests);
    }

    /**
     * 修改请假申请
     * 
     * @param perLeaveRequests 请假申请
     * @return 结果
     */
    @Override
    public int updatePerLeaveRequests(PerLeaveRequests perLeaveRequests)
    {
        perLeaveRequests.setUpdateTime(DateUtils.getNowDate());
        return perLeaveRequestsMapper.updatePerLeaveRequests(perLeaveRequests);
    }

    /**
     * 批量删除请假申请
     * 
     * @param overtimeIds 需要删除的请假申请主键
     * @return 结果
     */
    @Override
    public int deletePerLeaveRequestsByOvertimeIds(Long[] overtimeIds)
    {
        return perLeaveRequestsMapper.deletePerLeaveRequestsByOvertimeIds(overtimeIds);
    }

    /**
     * 删除请假申请信息
     * 
     * @param overtimeId 请假申请主键
     * @return 结果
     */
    @Override
    public int deletePerLeaveRequestsByOvertimeId(Long overtimeId)
    {
        return perLeaveRequestsMapper.deletePerLeaveRequestsByOvertimeId(overtimeId);
    }
}
